package com.cyzy.utils;

import com.auth0.jwt.JWT;
import com.auth0.jwt.algorithms.Algorithm;

import java.util.Date;

public class TokenUtils {

    private static String sign="lsycyzy";

    public static String createToken(String content){
        long time = System.currentTimeMillis()+30*60*1000;
        String token = JWT.create().withSubject(content)    //内容
                .withExpiresAt(new Date(time))      //过期时间
                .sign(Algorithm.HMAC256(sign));      //算法和签名
        return token;
    }

}
